//
//  BQBaseRequest.h
//  honeycomb
//
//  Created by billionsfinance-resory on 16/2/26.
//  Copyright © 2016年 www.bqjr.cn. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>

typedef NS_ENUM(NSUInteger, netWorkRequestType) {
    netWorkRequestGet,              // GET方法
    netWorkRequestPost,             // POST方法
    netWorkRequestPostMultipart,    // 上传二进制数据
};

typedef void(^netWorkRequestSuccess)(id response);   // 成功回调
typedef void(^netWorkRequestFailed)(id response);    // 失败回调

@interface BQBaseRequest : NSObject


/**
 *  GET方式发网络请求
 *
 *  @param baseUrl   基础URL
 *  @param parameter 字典参数
 *  @param success   成功返回时,处理block
 *  @param failed    失败返回时,处理block
 */
+ (void)getRequestWithBaseUrl:(NSString *)baseUrl
                 andParameter:(NSDictionary *)parameter
           andSuccessCallBack:(netWorkRequestSuccess)success
            andFailedCallBack:(netWorkRequestFailed)failed;

/**
 *  POST方式发起网络请求
 *
 *  @param baseUrl   基础URL
 *  @param parameter 字典参数
 *  @param success   成功返回时,处理block
 *  @param failed    失败返回时,处理block
 */
+ (void)postRequestWithBaseUrl:(NSString *)baseUrl
                  andParameter:(NSDictionary *)parameter
            andSuccessCallBack:(netWorkRequestSuccess)success
             andFailedCallBack:(netWorkRequestFailed)failed;

/**
 *  POST方式上传图片
 *
 *  @param baseUrl       基础URL
 *  @param parameter     字典参数
 *  @param imageDataArrs 图片二进制数据
 *  @param success       成功返回时,处理block
 *  @param failed        失败返回时,处理block
 */
+ (void)postImageDataWithBaseUrl:(NSString *)baseUrl
                    andParameter:(NSDictionary *)parameter
                andImageArr:(NSArray *)imageDataArrs
                      andSuccess:(netWorkRequestSuccess)success
                       andFailed:(netWorkRequestFailed)failed;


@end
